'use strict';

const Controller = require('egg').Controller;

class LoginController extends Controller {
    async index() {
        const { ctx } = this;
        const {username,password}=ctx.request.body
        const post = await this.app.mysql.get('userlist', { username: `${username}`,password:`${password}` });
        if(post){
            ctx.body={
                code:200,
                mes:'登录成功'
            }
        }else{
            ctx.body={
                code:403,
                mes:'登录失败'
            }
        }
    }
}

module.exports = LoginController;
